﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
using Kingdee.BOS;
using Kingdee.BOS.Util;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Core.Report.PlugIn.Args;
using Kingdee.BOS.Core.Bill;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.SqlBuilder;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Contracts.Report;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.App.Data;


namespace KD_DMG_ZLFXBILL
{
    [Description("其他应付账报表金额字段显示千分位")]
    public class QTYFBillEdit : AbstractSysReportPlugIn
    {
        public override void FormatCellValue(Kingdee.BOS.Core.Report.PlugIn.Args.FormatCellValueArgs args)
        {

            base.FormatCellValue(args);

            if (!args.Header.FieldName.EqualsIgnoreCase("id") && !args.Header.FieldName.EqualsIgnoreCase("FDWNumber") && !args.Header.FieldName.EqualsIgnoreCase("FDWName") 
               && !args.Header.FieldName.EqualsIgnoreCase("FKXNumber") && !args.Header.FieldName.EqualsIgnoreCase("FKXName") && !args.Header.FieldName.EqualsIgnoreCase("FKMName"))
            {
                args.FormateValue = String.Format("{0:N}", args.Value);
            }
        }

        public override void OnFormatRowConditions(ReportFormatConditionArgs args)
        {
            base.OnFormatRowConditions(args);
            //行背景色：

            FormatCondition fc = new FormatCondition();

            if (args.DataRow["FACCOUNTBOOKName"].ToString().Contains("小计"))
            {

                fc.BackColor = "#ADFF2F";// 背景色蓝色;

            }
            if (args.DataRow["FACCOUNTBOOKName"].ToString().Contains("合计"))
            {

                fc.BackColor = "#ADFF2F";// 背景色蓝色;

            }
            args.FormatConditions.Add(fc);
        }
    }
}
